#e
#Title[uZgG̓v]
#Text[̓ɑD̂ւɂƂƂg̗dBʏɎTU炳êقƂǂeBAHXqĺuz̉AvɎĂCB]
#Image[.\img\ExRumia(u~bhiCg@Gv).png]
#BackGround[Default]
#BGM[.\BGM\thA07]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾;
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
        let eco00=GetCurrentScriptDirectory~"SE\eco00.wav";
        let bom36=GetCurrentScriptDirectory~"SE\bom36.wav";
        let shot1=GetCurrentScriptDirectory~"SE\shot1.wav";
	let imgLittle=GetCurrentScriptDirectory~"img\RumiaCutIn.png";
	let imgAngle=0;
	let imgeffect_magic=GetCurrentScriptDirectory~"img\effect_magic.png";
	let imgback04_06=GetCurrentScriptDirectory~"img\back04_06.png";
	let data_usershot=GetCurrentScriptDirectory~"USERSHOT\data_usershot.txt";	



        @Initialize
	{
		SetScore(30000);//XyJ[h{[iX30000ɐݒ
		SetLife(250);//Ct300ɐݒ
		SetDamageRate(10,5);//_[W10%ɐݒ
		SetTimer(60);//Ԑ60bɐݒ

		SetGraphicRect(1,1,64,64);//`挳`ݒ
		SetInvincibility(80);//G30t[Gɂ
		LoadGraphic(imgback04_06);
		LoadGraphic(imgExRumia);//摜uimg\ExRumia.pngvǂ݂		
		LoadGraphic(imgeffect_magic);
                LoadSE(eco00);
		LoadUserShotData(data_usershot);
                LoadSE(bom36);
                LoadSE(shot1);
		SetMovePosition02(cx,60,60);//W(cx,60)60t[Ĉړ
		Concentration01(150);
		CutIn(YOUMU,"uZgG̓v",imgLittle,1,1,350,525);//XyJ[h\
	}
	
	@MainLoop
	{
                
                if(count==110){ 


                               PlaySE(eco00);
                               }

                if(count==100){ 
                               Concentration01(120);
                               }  
		if(count>200&&count%20==2)
                {
			let ang=GetAngleToPlayer();
                        let shotA=0;
                        PlaySE(bom36);
			PlaySE(shot1);
                        loop(3) {
			          CreateShotA(shotA,GetX(),GetY(),10);//shotA쐻
			          SetShotDataA(shotA,0,5,ang-30,0,0.08,10,PURPLE03);//shotAɃf[^o^;
			
			          let i=0;
			
                                  while(i<70)
			                    {//360JԂ
				            let shotSpeed=rand(0.1,2);
                                            
				            let ta=10;
				            CreateShotA(ta,0,0,60);//ta쐻
                                            SetShotDataA(ta,0,shotSpeed,-90,0,0,0,47);
				            SetShotKillTime(ta,400);
                                            AddShot(i,shotA,ta,0);//shotAtao^;
                                            
				            i+=3;
			                    }
			            FireShot(shotA);
                                    
                                    ang += 30;
                                   }

                 }
                if(count==400)
		{
			SetMovePositionRandom01(75,40,5,GetClipMinX()+100,30,GetClipMaxX()-100,100);
		}
	
		if(count==500){
                               count=60;
                               };
		SetCollisionA(GetX(),GetY(),64);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
		count++;
	}
	
	@Finalize
	{//ǂ݂񂾃t@C폜
		DeleteGraphic(imgExRumia);	
		DeleteGraphic(imgeffect_magic);
		DeleteGraphic(imgback04_06);

		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	
	@DrawLoop
	{
		//Ex[~A`
		if(count<200){SetGraphicRect(64,64,127,127)};
		if(count>=200){SetGraphicRect(1,1,64,64);}
		SetGraphicAngle(0,0,0);
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());

		
			SetGraphicRect(0,80,150,230);
			SetAlpha(255);
			SetGraphicAngle(0,0,-imgAngle);
			SetTexture(imgeffect_magic);
			DrawGraphic(GetX(),GetY());
			imgAngle+=0.5;

			SetGraphicRect(300,230,450,380);
			SetAlpha(255);
			SetGraphicAngle(0,0,imgAngle);
			SetTexture(imgeffect_magic);
			DrawGraphic(GetX(),GetY());
			
	}

	@BackGround
	{
	//XyJ[h̔wi
	//Ă悢


		SetTexture(imgback04_06);
		SetGraphicRect(1,1,512,512);
		SetAlpha(100);
		SetGraphicAngle(0,0,0);
		DrawGraphic(GetCenterX,GetCenterY);
		
	}
 

}